package homework.day01;

import java.io.File;
import java.io.FileFilter;

public class Text06 {
    public static void main(String[] args) {
        File file = new File("./");
      /*  FileFilter filt = new FileFilter() {
            @Override
            public boolean accept(File fil) {
                return fil.getName().contains("s");
            }
        };
        File[] files=file.listFiles(filt);
        for (File f:files){
            System.out.println(f);
        }*/

        /*File[] files=file.listFiles(p->p.getName().contains("s"));
        for (File f:files){
            System.out.println(f);
        }*/

        File[] files=file.listFiles(new FileFilter() {
            @Override
            public boolean accept(File fil) {
                return fil.getName().contains("s");
            }
        });
        for (File f:files){
            System.out.println(f);
        }
    }
}
